package com.zhejiangzhengyuan.municipal_common.utils.httpUtils;

import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;

/**
 * @author lin_ju
 * Create on 2019/11/26
 * */
public class ErrorResultUtil {
  public static String getErrorMessage(BindingResult result) {
    FieldError fieldError = result.getFieldError();
    return fieldError == null ? "参数验证未通过" : fieldError.getDefaultMessage();
  }
}
